<?php
$sv=$_SESSION['ma_cb'];
$sql_diemcc="  SELECT  tbl_dangkymon.ma_dkm,ten_mh,madm_tieuchimonhoc,trongso,diem_kqqt
        FROM    tbl_dangkymon,tbl_ketquaquatrinh,tbl_monctdt_tieuchi,tbl_mon_ctdt,dm_monhoc
        WHERE   tbl_dangkymon.ma_dkm = tbl_ketquaquatrinh.ma_dkm
        AND     tbl_ketquaquatrinh.ma_monctdt_tieuchi = tbl_monctdt_tieuchi.ma_monctdt_tieuchi
        AND     tbl_monctdt_tieuchi.ma_mon_ctdt = tbl_mon_ctdt.ma_mon_ctdt
        AND     tbl_mon_ctdt.ma_monhoc=dm_monhoc.madm_mh
        AND     ma_sv='$sv'
        AND     madm_tieuchimonhoc='cc'";
$ex_diemcc=mysql_query($sql_diemcc);
while($row=mysql_fetch_array($ex_diemcc)){
    $dsdiemcc[]=$row;
}

$sql_diemdk="  SELECT  tbl_dangkymon.ma_dkm,madm_tieuchimonhoc,trongso,diem_kqqt
                FROM    tbl_dangkymon,tbl_ketquaquatrinh,tbl_monctdt_tieuchi
                WHERE   tbl_dangkymon.ma_dkm = tbl_ketquaquatrinh.ma_dkm
                AND     tbl_ketquaquatrinh.ma_monctdt_tieuchi = tbl_monctdt_tieuchi.ma_monctdt_tieuchi
                AND     ma_sv='$sv'
                AND     madm_tieuchimonhoc='dk'";

$ex_diemdk=mysql_query($sql_diemdk);
while($row=mysql_fetch_array($ex_diemdk)){
    $dsdiemdk[]=$row;
}

$sql_diemthi="  SELECT  tbl_dangkymon.ma_dkm,lanthi,diemthi
                FROM    tbl_dangkymon,tbl_diemthi
                WHERE   tbl_dangkymon.ma_dkm=tbl_diemthi.ma_dkm
                AND     ma_sv='$sv'";

                
$ex_diemthi=mysql_query($sql_diemthi);
while($row=mysql_fetch_array($ex_diemthi)){
    $dsdiemthi[]=$row;
}


$smarty->assign('dsdiemcc',$dsdiemcc);
$smarty->assign('dsdiemdk',$dsdiemdk);
$smarty->assign('dsdiemthi',$dsdiemthi);
//$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$
$smarty->display('diem/sv_xemdiem.tpl');   
?>